import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.*;
import javax.swing.JTextArea;
import java.awt.BorderLayout;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class UserInterface {
	
	public UserInterface() {	
	}
	
	public void launchTheProg() {
		BaseWindow mainWindow = new BaseWindow();
		mainWindow.setUp();
	}
	
	public static void main(String[] args) {
		UserInterface ui = new UserInterface();
		ui.launchTheProg();
	}
}


public class BaseWindow {

	public static final int BASEHEIGHT = 600;
	public static final int BASEWIDTH = 400; 
	public static final String PROG_NAME = "Tasky V0.0";
	
	
	private JTextArea area = new JTextArea(20,120);
	private JFileChooser dialog = new JFileChooser(System.getProperty("user.dir"));
	private String currentFile = "Untitled";
	private boolean changed = false;
	
	
	public BaseWindow(){		
	}
	
	public void setUp() {
		

		//TestStorage newStore = new TestStorage();
		//TestHistory newHistory = new TestHistory(newStore);
		//TestLogic newLogic = new TestLogic(newStore, newHistory);

		//newLogic.run();
		
		JFrame baseFrame = new JFrame(PROG_NAME);
		
		TextWindow topWindow = new TextWindow(10,15);
		TextWindow botWindow = new TextWindow(20,30);
		
		JPanel panel = new JPanel();
		panel.add(new JButton("ok"));
		
		
		area.setFont(new Font("Monospaced",Font.PLAIN,12));
		JScrollPane scroll = new JScrollPane(area,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
		baseFrame.add(scroll,BorderLayout.CENTER);
		
		//baseFrame.add(topWindow.getTextWindow(), BorderLayout.CENTER);
		
		
		/*
		final JTextField jTextf =new JTextField(20);
		
		final JTextArea jTextA = new JTextArea(20,20);
		jTextA.setEditable(false);
		
		jTextf.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				String enteredText = jTextf.getText();
				JOptionPane.showMessageDialog(null, "You entered a Task", "Test", 1);
				jTextA.append(enteredText);
				jTextA.append("\n");
				/**String str = JOptionPane.showInputDialog(null,
						"Task : ", "hi", 1);
				if (str != null)
					JOptionPane
							.showMessageDialog(null, "Task Entered : "
									+ str, "hi",1);
				else
					JOptionPane.showMessageDialog(null,
							"Cancelled Task.", "hi", 1);
							--CommentStopHere
			}
		});*/
		JPanel panel = new JPanel();
		//panel.setLayout(new GridLayout(0,1));
		//panel.setBorder(new LineBorder(Color.GRAY));
		//panel.add(jTextA);
		//panel.add(new JLabel("Enter:"));
		//panel.add(jTextf);
		//frame.add(panel);
		baseFrame.setSize(BASEHEIGHT, BASEWIDTH);
		baseFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		baseFrame.setVisible(true);
		

		
	}
	
	
}




public class TextWindow {

	public static JTextArea jTextf;
	
	public TextWindow(int THeight, int TWidth) {
		 jTextf = new JTextArea(THeight,TWidth);
	}
	
	public JTextArea getTextWindow() {
		return jTextf;
	}
	
	
}
